define(['../../../../../js/lib/other/sweet-alert'],function() {
    return ['$scope','$location', '$interval','$timeout','bizProxy', function($scope,$location,$interval,$timeout,bizProxy) {
		$scope.$emit("top-show",'true');//顶部显示
    	$scope.$emit('menuTypeLight','mine'); 	//控制底部menu高亮
    	$scope.$emit('bub-menu','true'); 	//隐藏底部menu
    	$scope.$emit('flag-tag','17');//显示底部文字
    	
    	//默认值
    	$scope.mobileNo = transData.mobileNo;
    	$scope.oldPwd = _YHC_util.strToArr("");
    	var tempRandom = 2.5,tempRandom1 = 10,tempPassword = "";
    	$scope.$emit("pwdSlidUp",5);
    	
    	//监听子集显示顶部显示
        $scope.$on('pwdChange', function(event, data) {
        	$timeout(function(){
        		if(data.length == 6){
        			tempPassword = data;
        		}
        		$scope.oldPwd = _YHC_util.strToArr(data);
        	},0);
        });
    	
    	//点击获取密码数据
    	$scope.getPassword = function(){
    		$scope.$emit("pwdSlidUp",tempRandom++);
    	}
    	
    	
    	//监听第一次密码输入
    	$scope.$watch('oldPwd', function() {
    		if(($scope.oldPwd)[5] != ""){
    			var headerInfo = {},sendData = {};
            	headerInfo.pageNum = '';
            	headerInfo.pageSize = '';
            	headerInfo.sessionId = transData.sessionId;
            	
            	sendData.loginType = "password";
        		sendData.mobileNo = transData.mobileNo;
        		sendData.password = tempPassword;
        		$scope.$emit("loadingChangeNav",true);
        		bizProxy.queryProxyBizData("userLogin",headerInfo,sendData,
        				function(tempData){//SUCCESS
        					localStorage.setItem("fireFlySessionId",tempData.sessionId+"");
        					$scope.$emit("loadingChangeNav",false);
        					transData.password = tempPassword;
        					$timeout(function(){
        	    				$scope.$emit("goNext","/resetPwdFirst");
        	    			},200);
    		    		},function(data){//FAIL
    		    			$scope.$emit("loadingChangeNav",false);
    		    			$timeout(function(){
    		    				$scope.oldPwd = _YHC_util.strToArr("");
	        					$scope.$emit("assignPwd",(tempRandom1++) + "");
	        				},0);
    		    			$scope.$emit("promptAlertMsg","密码输入错误");
    		    			$scope.$emit("showCollect",true);
    		    			$timeout(function(){
    		    				$scope.$emit("showCollect",false);
    		    			},transData.promptTime);
    		    			return;
    		    		});
    			
    		}
		});
    	
    	//当键盘被销毁的时候
        $scope.$on("$destroy", function() {
        	$scope.$emit("pwdSlidUp","");
	    });
        $scope.$apply();
    }];
});